﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestMatrix.Model
{
    public class tblReleaseInfo : INotifyPropertyChanged, INotifyPropertyChanging
    {
        public tblReleaseInfo()
        {
           
        }

        public tblReleaseInfo(
            int id
            , string EBIProjectName
            , string YYYYMM
            , int ReleaseCnt
            , int ReleaseTimes
            , int TestCaseCnt
            , int ChangeSetCnt
            , int FixedBug
            , int ChangeRequest
            , int Feature
            , int Issue
            , int Task
            , int UserStory
            )
        {
            this.ID = id;
            this.EBIProjectName = EBIProjectName;
            this.YYYYMM = YYYYMM;
            this.ReleaseCnt = ReleaseCnt;
            this.ReleaseTimes = ReleaseTimes;
            this.TestCaseCnt = TestCaseCnt;
            this.ChangeSetCnt = ChangeSetCnt;
            this.FixedBug = FixedBug;
            this.ChangeRequest = ChangeRequest;
            this.Feature = Feature;
            this.Issue = Issue;
            this.Task = Task;
            this.UserStory = UserStory;
        }

        private int _ID;

        public int ID
        {
            get { return _ID; }
            set
            {
                if (_ID != value)
                {
                    NotifyPropertyChanging("ID");
                    _ID = value;
                    NotifyPropertyChanged("ID");
                }
            }

        }

        private string _EBIProjectName;

        public string EBIProjectName
        {
            get { return _EBIProjectName; }
            set
            {
                if (_EBIProjectName != value)
                {
                    NotifyPropertyChanging("EBIProjectName");
                    _EBIProjectName = value;
                    NotifyPropertyChanged("EBIProjectName");
                }
            }
        }

        private string _YYYYMM;

        public string YYYYMM
        {
            get { return _YYYYMM; }
            set
            {
                if (_YYYYMM != value)
                {
                    NotifyPropertyChanging("YYYYMM");
                    _YYYYMM = value;
                    NotifyPropertyChanged("YYYYMM");
                }
            }
        }

        private int _ReleaseCnt;

        public int ReleaseCnt
        {
            get { return _ReleaseCnt; }
            set
            {
                if (_ReleaseCnt != value)
                {
                    NotifyPropertyChanging("ReleaseCnt");
                    _ReleaseCnt = value;
                    NotifyPropertyChanged("ReleaseCnt");
                }
            }

        }

        private int _ReleaseTimes;

        public int ReleaseTimes
        {
            get { return _ReleaseTimes; }
            set
            {
                if (_ReleaseTimes != value)
                {
                    NotifyPropertyChanging("ReleaseTimes");
                    _ReleaseTimes = value;
                    NotifyPropertyChanged("ReleaseTimes");
                }
            }

        }

        private int _TestCaseCnt;

        public int TestCaseCnt
        {
            get { return _TestCaseCnt; }
            set
            {
                if (_TestCaseCnt != value)
                {
                    NotifyPropertyChanging("TestCaseCnt");
                    _TestCaseCnt = value;
                    NotifyPropertyChanged("TestCaseCnt");
                }
            }

        }

        private int _ChangeSetCnt;

        public int ChangeSetCnt
        {
            get { return _ChangeSetCnt; }
            set
            {
                if (_ChangeSetCnt != value)
                {
                    NotifyPropertyChanging("ChangeSetCnt");
                    _ChangeSetCnt = value;
                    NotifyPropertyChanged("ChangeSetCnt");
                }
            }

        }

        private int _FixedBug;

        public int FixedBug
        {
            get { return _FixedBug; }
            set
            {
                if (_FixedBug != value)
                {
                    NotifyPropertyChanging("FixedBug");
                    _FixedBug = value;
                    NotifyPropertyChanged("FixedBug");
                }
            }

        }

        private int _ChangeRequest;

        public int ChangeRequest
        {
            get { return _ChangeRequest; }
            set
            {
                if (_ChangeRequest != value)
                {
                    NotifyPropertyChanging("ChangeRequest");
                    _ChangeRequest = value;
                    NotifyPropertyChanged("ChangeRequest");
                }
            }

        }

        private int _Feature;

        public int Feature
        {
            get { return _Feature; }
            set
            {
                if (_Feature != value)
                {
                    NotifyPropertyChanging("Feature");
                    _Feature = value;
                    NotifyPropertyChanged("Feature");
                }
            }

        }

        private int _Issue;

        public int Issue
        {
            get { return _Issue; }
            set
            {
                if (_Issue != value)
                {
                    NotifyPropertyChanging("Issue");
                    _Issue = value;
                    NotifyPropertyChanged("Issue");
                }
            }

        }

        private int _Task;

        public int Task
        {
            get { return _Task; }
            set
            {
                if (_Task != value)
                {
                    NotifyPropertyChanging("Task");
                    _Task = value;
                    NotifyPropertyChanged("Task");
                }
            }

        }

        private int _UserStory;

        public int UserStory
        {
            get { return _UserStory; }
            set
            {
                if (_UserStory != value)
                {
                    NotifyPropertyChanging("UserStory");
                    _UserStory = value;
                    NotifyPropertyChanged("UserStory");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        // Used to notify that a property changed
        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        // Used to notify that a property is about to change
        private void NotifyPropertyChanging(string propertyName)
        {
            if (PropertyChanging != null)
            {
                PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
            }

        }
    }
}
